source(here::here("code/load.R"))

here("data/meta_analyses_raw/Bal2010/Bal2010.csv") |>
    read_csv() |>
    mutate(
        meta_id = "Bal2010",
        # The publication date is absent from the dataset but the paper indicates it was 2008.
        study_id = ifelse(`Study name` == "Jensen et al. (UP)", "Jensen et al. (2008)", `Study name`),
        study_year = as.numeric(gsub(".*(\\d{4}).*", "\\1", study_id)),
        subfield = "PE",
        question = "Does communication faciliate cooperation?") |>
    select(meta_id,
        study_id,
        estimate = `Std diff in means`,
        std.error = `Std Err...4`,
        study_year,
        # article includes an overall analysis, so we don't include a DV variable
        # dv = `Type of Dilemma`,
        subfield,
        question) |>
    write_csv(here("data", "meta_analyses_clean", "Bal2010.csv"))
